<?php

namespace app\common\enum;


class OrderEnum
{
    /**
     * 订单状态 0待支付,1已支付/待接单,2已接单/待出发,3已出发/待到达,4已到达/待开始服务,5已开始服务/待完成,6已完成,7已取消,8已关闭,9待补单,10补单完成,11申诉补单,
     */
    const ORDER_ADD = 0; //待支付
    const ORDER_PAY  = 1; //已支付
    const ORDER_GET =  2; //已接单
    const ORDER_GO =  3; //已出发
    const ORDER_ARRIVE =  4; //已到达
    const ORDER_STAR_SERVICE =  5; //开始服务
    const ORDER_FINISH_SERVICE =  6; //完成服务
    const ORDER_STOP = 7; //取消支付
    const ORDER_CLOSE = 8; //关闭
    const ORDER_BU = 9; //客户待补单
    const ORDER_BU_FINISH = 10; //完成补单
    const ORDER_BU_SHENSU = 11; //申诉补单
    const ORDER_USER_TUI = 12; //用户退款
    const ORDER_TECHN_TUI = 13; //技师退款
    const ORDER_TECHN_JU = 14; //技师拒单
    const ORDER_PAY_CHAO = 15; //支付超时
    const ORDER_PAY_QUXIAO = 16; //客户补单完成
    const ORDER_TECHN_NO_DO = 17; //技师未接单


    public static function getOrderStatusDesc($type=true)
    {
        $desc = [
            self::ORDER_ADD => '待支付',
            self::ORDER_PAY => '已支付',
            self::ORDER_GET => '已接单',
            self::ORDER_GO => '已出发',
            self::ORDER_ARRIVE => '已到达',
            self::ORDER_STAR_SERVICE => '开始服务',
            self::ORDER_FINISH_SERVICE => '完成服务',
            self::ORDER_STOP => '取消支付',
            self::ORDER_CLOSE => '关闭',
            self::ORDER_BU => '客户待补单',
            self::ORDER_BU_FINISH => '完成补单',
            self::ORDER_BU_SHENSU => '申诉补单',
            self::ORDER_USER_TUI => '用户退款',
            self::ORDER_TECHN_TUI => '技师退款',
            self::ORDER_TECHN_JU => '技师拒单',
            self::ORDER_PAY_CHAO => '支付超时',
            self::ORDER_PAY_QUXIAO => '客户补单完成',
            self::ORDER_TECHN_NO_DO => '技师未接单',
        ];
        if ($type === true){
            return $desc;
        }
        return $desc[$type] ?? '';
    }

}